#include<fstream>
#include<sstream>
#include<iostream>

void ParseFile(const std::string& filepath)
{
    std::ifstream stream(filepath);
    std::string line;
    std::ostringstream ss;
    while(std::getline(stream,line))
    {
        if(line.find("ifstream")!=std::string::npos)
        // ifstream mode
            std::cout<<line<<std::endl;
        else if(line.find("sstream")!=std::string::npos)
        // sstream mode
            ss<<line;
    }
    std::cout<<ss.str()<<std::endl;
}


int main()
{
    //Inface in C++17, we can use '<filesystem>' to handle file path
    //but...I dont't want to use that.... 
    ParseFile("../res/test.txt");
    return 0;
}